package com.hzz.framework.fileServer.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

@Data
@Configuration
@ConfigurationProperties(prefix = "file-server")
public class FileServerProperties {
    String rootFolder; // /home/hsd/fileServer/
    String upload; //${fileServer.rootFolder}upload/
    String download; //http://192.168.108.100:28890/hsd-file-server/upload/ #/upload/
    int imageWidth = 1600;
    String richEditor = "isrich";//富文本编辑器上传标记
    FileType fileType;//上传的文件种类,生成的文件夹
    FileExt fileExt;//文件扩展名,白名单
    FileSize fileSize;//文件大小 单位M

    @Data
    public static class FileType {
        String image = "image";//图片
        String audio = "audio";//音频
        String media = "media";//多媒体
        String file = "file";//普通文件
    }

    @Data
    public static class FileExt {
        String image = ".jpg";//图片
        String audio = ".mp3";//音频
        String media = ".mp4";//多媒体
        String file = ".txt";//普通文件
    }

    @Data
    public static class FileSize {
        long image = 2;
        long audio = 25;
        long media = 200;
        long file = 50;
    }
//
//    public static void main(String[] args) {
//        String[] ss=".png,jpg,jpeg,gif,bmp,flv,swf,mkv,avi,rm,rmvb,mpeg,mpg,ogg,ogv,mov,wmv,mp4,webm,mp3,wav,mid,rar,zip,tar,gz,7z,bz2,cab,iso,doc,docx,xls,xlsx,ppt,pptx,pdf,txt,md,xml".split("\\,");
//        for(String s:ss)
//        System.out.println(s);
//    }
}
